#ifndef __SHT3X_H
#define __SHT3X_H

#include "sys.h"


#define SDA_IN_sht30()  {GPIOA->MODER&=~(3<<(7*2));GPIOA->MODER|=0<<7*2;}	
#define SDA_OUT_sht30() {GPIOA->MODER&=~(3<<(7*2));GPIOA->MODER|=1<<7*2;} 
 
#define IIC_SCL_sht30    PCout(1) //SCL
#define IIC_SDA_sht30    PAout(7) //SDA	 
#define READ_SDA_sht30   PAin(7)  //SDA 

//extern unsigned short int SHT30_temperature;
//extern unsigned short int SHT30_humidity; 

void IIC_Init_sht30(void);
void IIC_Start_sht30(void);
void IIC_Stop_sht30(void);
void IIC_Ack_sht30(void);
void IIC_NAck_sht30(void);
u8 IIC_Wait_Ack_sht30(void);
void IIC_Send_Byte_sht30(u8 txd);
u8 IIC_Read_Byte_sht30(unsigned char ack);
void sht30_read_temp_humi(void);

#endif

